#!/bin/sh
echo "Proximity Detector"
a=0
mac='00:25:47:09:95:67'
if [ -z "`hcitool cc $mac 2>&1 sed 's/Scanning/d'`" ];then
while [ $a -lt 3 ]
do
	
	signal=$(hcitool rssi 00:25:47:09:95:67 |awk '{print int($4)}')
	if [ $signal -gt -15 ]; then
		echo "Here"
	else
		echo "Logged OFF"
	fi
	a=`expr $a + 1`
	sleep 3.5s
done
fi
